<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$return['basic']=$this->plugin_setting('basic');
$return['banner']=$return['basic']['hdps'];
if($_RQ['op']=='main'){
	/*******main*******/
	//路线
	$id=$_RQ['id'];
	if(!$id){
		exi('该路线可能已下架或已删除','error');
	}
	$way=pdo_get('jy_tour_way',array('uniacid'=>$_SESSION['uniacid'],'id'=>$id));
	if($way){
		$images=json_decode($way['images'],true);
		$merch=pdo_get('jy_tour_merch',array('uniacid'=>$_SESSION['uniacid'],'id'=>$way['merchid']));
		$way['merch']=$merch;
		$way['images']=$images;
		$destination_pcd=json_decode($way['destination_pcd'],true);
		$way['destination_pcd']=$destination_pcd['city'].$destination_pcd['district'];
	}
	$pingjianum=pdo_count('jy_tour_assess',array('uniacid'=>$_SESSION['uniacid'],'way_id'=>$way['id']));
	$pinjia_good=pdo_count('jy_tour_assess',array('uniacid'=>$_SESSION['uniacid'],'way_id'=>$way['id'],'star >'=>'3'));
	$way['manyidu']=number_format($pinjia_good/$pingjianum,0)*100;
	$way['pingjianum']=$pingjianum;
	$way['sellnum']=pdo_count('jy_tour_order',array('uniacid'=>$_SESSION['uniacid'],'way_id'=>$way['id'],'status >'=>'0'));
	$return['way']=$way;
	exi($return);
}
